/*import { showLoading, showError, closeLoading } from "@/utils/vant";
import { queryDrawVid } from "@/api/drawVid";
import { useDrawVidRefs } from "./useDrawVid";

const useFetchData = defineStore("fetch-drawVid", () => {
  const { finished } = useDrawVidRefs();
  const list = ref<any>([]);
  const total = ref(0);
  const isFetching = ref(false);
  const params = reactive({
    page: 1,
    size: 20
  });
  function resetParams() {
    params.page = 1;
    params.size = 20;
  }
  async function fetchData() {
    try {
      isFetching.value = true;
      showLoading();
      const res = await queryDrawVid(params);
      list.value = [...res.data.list, ...list.value];
      total.value = res.data.total;
      console.log(1111, list.value, 2222, total.value);
      if (unref(list).length >= total.value) {
        finished.value = true;
      }
    } catch (error) {
      showError(error);
    } finally {
      isFetching.value = false;
      closeLoading();
    }
  }
  // onMounted(() => {
  //   fetchData();
  // });

  return {
    list,
    total,
    fetchData,
    params,
    resetParams,
    isFetching
  };
});
export const useFetchDataRefs = () => storeToRefs(useFetchData());
export default useFetchData;
*/
